# Maintainer: Andreas Radke <andyrtr@archlinux.org>
# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgname=xorg-mkfontscale
pkgver=1.2.1
pkgrel=2
pkgdesc="Create an index of scalable font files for X"
arch=(x86_64)
url="https://xorg.freedesktop.org/"
license=('custom')
install=xorg-mkfontscale.install
depends=('freetype2' 'libfontenc')
makedepends=('xorg-util-macros' 'xorgproto')
groups=('xorg-apps' 'xorg')
provides=('xorg-mkfontdir')
conflicts=('xorg-mkfontdir')
replaces=('xorg-mkfontdir')
source=(https://xorg.freedesktop.org/archive/individual/app/mkfontscale-${pkgver}.tar.bz2{,.sig}
        xorg-mkfontscale.hook
        xorg-mkfontscale.script)
sha512sums=('4d243160e1f7f8dfa6a8f53349c1a42a55fc99426455ebdef58352c5e951fce8b4f1fbd1061a76c9a148095b002eac372db1ae5e2647d2ccb4886635b317b18c'
            'SKIP'
            '3c42bd72d88200a63159e84f8b04045aaf5c176ef98711a4196fad92a96467103368212e13571a8eeef929b2c7affe6c40797f67596fccc955750dcf7c1b3646'
            '2a53d38c85b962eaee534f6f3fad4122412a7200c6787fd8216eb191904e2e3727400606a73d6f09017016f6c1360e5148afbb8fbe16e35c5e5cd55dec635387')
validpgpkeys=('4A193C06D35E7C670FA4EF0BA2FB9E081F2D130E') # Alan Coopersmith <alan.coopersmith@oracle.com>

build() {
  cd "${srcdir}/mkfontscale-${pkgver}"
  ./configure --prefix=/usr
  make
}

package() {
  cd "${srcdir}/mkfontscale-${pkgver}"
  make DESTDIR="${pkgdir}" install
  install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
  install -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/"

  install -Dm644 ../xorg-mkfontscale.hook "${pkgdir}/usr/share/libalpm/hooks/xorg-mkfontscale.hook"
  install -D ../xorg-mkfontscale.script "${pkgdir}/usr/share/libalpm/scripts/xorg-mkfontscale"
}
